import React from 'react'
import ReactEcharts from "echarts-for-react";
export default function index(props) {
    let option = {
        tooltip: {
            trigger: 'item'
        },
        legend: props.legend,
        series: [
            {
                type: 'pie',
                data: props.S_data,
                ...props.S_other
            }
        ]
    };
    return <ReactEcharts style={{ height: props.height }} option={option} />
}
// 设置默认 props
index.defaultProps = {
    height: '500px',
    S_data: [
        { value: 40, name: 'rose 1' },
        { value: 38, name: 'rose 2' },
        { value: 32, name: 'rose 3' },
        { value: 30, name: 'rose 4' },
        { value: 28, name: 'rose 5' },
        { value: 26, name: 'rose 6' },
        { value: 22, name: 'rose 7' },
        { value: 18, name: 'rose 8' }
    ],
    legend: { top: 'bottom' },
    S_other: {
        // radius: [10, 200],
        center: ['50%', '45%'],
        roseType: 'area',
        itemStyle: {
            borderRadius: 5
        },
    }
};